import {MockMethod} from 'vite-plugin-mock'
import {baseApi} from "../config";

export default [
    { // 个人中心
        url: `${baseApi}/system/personal/getPersonalInfo`,
        method: 'get',
        response: () => {
            return {
                "code": 0,
                "message": "",
                "data": {
                    "user": {
                        "id": 31,
                        "userName": "demo",
                        "mobile": "15334455789",
                        "userNickname": "李四",
                        "birthday": 0,
                        "userPassword": "",
                        "userSalt": "",
                        "userStatus": 1,
                        "userEmail": "123@qq.com",
                        "sex": 2,
                        "avatar": "upload_file/2022-11-11/co9copop81co0gysbz.jpg",
                        "deptId": 109,
                        "remark": "3",
                        "isAdmin": 1,
                        "address": "云南省曲靖市22223",
                        "describe": "生活变的再糟糕，也不妨碍我变得更好",
                        "lastLoginIp": "::1",
                        "lastLoginTime": "2024-11-08 09:14:50",
                        "createdAt": "2021-06-22 17:58:00",
                        "updatedAt": "2022-11-11 17:25:27",
                        "deletedAt": null
                    },
                    "roles": [
                        "普通管理员"
                    ],
                    "deptName": "财务部门"
                }
            }
        }
    },
    { // 更新个人信息
        url: `${baseApi}/system/personal/edit`,
        params: {
            "nickname": "李四",
            "userEmail": "123@qq.com",
            "describe": "生活变的再糟糕，也不妨碍我变得更好",
            "mobile": "15334455789",
            "sex": "2",
            "remark": "3",
            "avatar": "upload_file/2022-11-11/co9copop81co0gysbz.jpg",
            "lastLoginIp": "::1",
            "lastLoginTime": "2024-11-08 09:14:50"
        },
        method: 'put',
        response: () => {
            return {
                "code": 0,
                "message": "",
                "data": {
                    "userInfo": {
                        "id": 31,
                        "userName": "demo",
                        "userNickname": "李四",
                        "userPassword": "",
                        "userSalt": "46PvWe1Sl7",
                        "userStatus": 1,
                        "isAdmin": 1,
                        "avatar": "upload_file/2022-11-11/co9copop81co0gysbz.jpg",
                        "deptId": 109
                    },
                    "token": "7ZUSfVIf2HyYjcv86SKPPs29v003ECPEScsdYsYYqO1OX7TJEtr+S2lU9CcEhck0DVHPU46yytvw2ssApxvxRgosspahV/FxdwJUvPjvz+I9B40GAkcsihpiOypfj0mhpSYqcOot9QYyKBEYc3/Eng=="
                }
            }
        }
    },
    {
        // 重置密码
        url: `${baseApi}/system/personal/resetPwd`,
        method: 'put',
        params: {"password": "demo"},
        response: () => {
            return {
                "code": 51,
                "message": "密码以字母开头，只能包含字母、数字和下划线，长度在6~18之间",
                "data": null
            }
        }
    },
] as MockMethod[]
